Tidy test control generation code
authorStuart Prescott <stuart@debian.org>
Sun, 2 Mar 2025 01:02:45 +0000 (12:02 +1100)
committerStuart Prescott <stuart@debian.org>
Sun, 2 Mar 2025 01:02:45 +0000 (12:02 +1100)
debian/tests/control.gen

index 06c3d7f6c43c36345b65e0e6ec08da4d09e84b86..1fe1d37b29c31c945f01c9b90be09a2ba106563b 100755 (executable)
@@ -1,7 +1,9 @@
 #!/bin/sh
 
+C=debian/tests/control
+
 # Remove debian/tests/control
-rm -f debian/tests/control
+rm -f $C
 
 # Create the basic (import) test for Python 3 modules
 for binary_package in $(dh_listpackages|grep "python3-pyside6.qt"); do
@@ -13,12 +15,12 @@ Depends:
  python3,
  $binary_package,
 Restrictions: allow-stderr, superficial
-Features: test-name=$binary_package" >>debian/tests/control
+Features: test-name=$binary_package" >> $C
     architecture=$(sed -n "/^Package: ${binary_package}$/{n; p}" debian/control)
     if [ "$architecture" != 'Architecture: any' ]; then
-        echo "$architecture" >>debian/tests/control
+        echo "$architecture" >> $C
     fi
-    echo "" >>debian/tests/control
+    echo "" >> $C
 done
 
-sed -i '$d' debian/tests/control
+sed -i '$d' $C